<?php
ob_start();
include('common/connection.php');
ob_start();
session_start();
include("common/connection.php");

$getPassword="SELECT * FROM admin WHERE admin_id ='$userName'";
$resultPassword=mysql_db_query($db_name,$getPassword);
$rsPassword=mysql_fetch_array($resultPassword);
$userPassword=$rsPassword['admin_pass'];
$useremail=$rsPassword['email'];
?>
<style type="text/css">
.b {
	border: thin solid #eeddcc;
}
.jobin_text1 {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 350px
}
.jobin_small {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 250px
}
.jobin_smalls {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 130px
}

.text2 {
	FONT-SIZE: 11px; FONT-WEIGHT: bold; COLOR: #4b507a; FONT-FAMILY: lucida grande, tahoma, verdana, arial, sans-serif; TEXT-DECORATION: none
}  
.top_border {
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: #009ACE;
} 
.style2 {color: #FF0000}
</style>
<script language="javascript">
function form_Validator(){
		var valid;
		//----------------email-validation start--------------//
		if (document.form1.oldPass.value =="")
		{
			alert("Please enter Old Password.");
			document.form1.oldPass.focus();
			valid = 0;
			return (false);
		}
		if (document.form1.password.value =="")
		{
			alert("Please Enter New Password");
			document.form1.password.focus();
			valid = 0;
			return (false);
		}
		if (document.form1.confirmpassword.value =="")

		{
			alert("Please Enter Confirm Password.");
			document.form1.confirmpassword.focus();	
			valid = 0;
			return (false);
		}
		if (document.form1.password.value!=document.form1.confirmpassword.value)
		{
			alert("Password and Confirm Password Don't Match.");
			document.form1.confirmpassword.focus();
			valid = 0;
			return (false);
		}
}
</script>
<form name="form1" method="post" action="containeradmin.php?area=admin&action=password_update_do">
<table width="100%"  border="0" cellspacing="1" cellpadding="1" align="center">
    
	<tr>
      <td colspan="3" bgcolor="#D5F4FF" class="top_border" style="font-family:verdana,arial;font-size:14px;font-weight:bold;color:#006666;" align="center"><table width="100%" border="0">
              <tr>
                <td align="center" class="style6 style7">Update  Password</td>
			  </tr>
          </table></td>
    </tr>
	
	<?php $mess=$_GET['mess'];if($mess){?>
    <tr bgcolor="#e9ece9">
	 <th colspan="4"><?php if($mess==1){echo "<font face='Verdana, Arial, Helvetica, sans-serif' color='#006633' size='2px'>Password Update Successful<font>";}elseif($mess==3){echo "<font face='Verdana, Arial, Helvetica, sans-serif' color='#FF0000' size='2px'>Old Password Does Not Match<font>";}else{echo "";}?></th>
    </tr>
	<?php }?>
	
    <tr bgcolor="#f8f8f8">
      <th width="46%" align="right" class="text2"><span class="style2">*</span>Old Password:</th>
      <td width="54%" colspan="2" align="left"><input type="password" name="oldPass" class='jobin_smalls'></td>
    </tr>
	
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right"><span class="style2">*</span>New Password: </th>
      <th colspan="2" align="left" valign="top"><input type="password" name="password" class='jobin_smalls'></th>
	</tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right"><span class="style2">*</span>Confirm New Password: </th>
      <th colspan="2" align="left" valign="top"><input type="password" name="confirmpassword" class='jobin_smalls'></th>
	</tr>	
	
	<tr align="right" bgcolor="#f8f8f8">
      <th colspan="3">&nbsp;</th>
    </tr>
	
	<tr>
      <th colspan="3"><input type="submit" name="Submit" value="Submit" onClick="return form_Validator()">
      <input type="reset" name="Submit2" value="Reset"><input type="hidden" name="uid" value="<?php echo $userName;?>"></th>
    </tr>
  </table>
</form>
